package com.ferry.serial.api;

/**
 * Created by daiyong
 * 序列化类型
 */
public enum SerializerType {

	HESSIAN((byte) 0x01),
	JDK((byte) 0x02),
	PROTOBUFF((byte) 0x03); //未实现

	private byte code;

	SerializerType(byte code) {
		this.code = code;
	}

	public static final SerializerType getDefault() {
		return HESSIAN;
	}

	public byte getCode() {
		return code;
	}

	public static SerializerType parse(String name) {
		for (SerializerType s : values()) {
			if (s.name().equalsIgnoreCase(name)) {
				return s;
			}
		}
		return null;
	}


}
